﻿<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<LINK rel="Bookmark" href="../images/favicon.ico">
<!-- 本框架基本脚本和样式 -->
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>

<!-- 界面单独引入的其他样式和脚本 -->
<link rel="stylesheet"
	href="${path }/resource/plugin/zTree/zTreeStyle/zTreeStyle.css"
	type="text/css">
<script type="text/javascript"
	src="${path }/resource/plugin/zTree/jquery.ztree.core-3.5.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/plugin/zTree/jquery.ztree.excheck.min.js"></script>


</head>
<style>
.permission-list>dd>dl>dt {width：140px；
	
}
</style>
<body>
	<div class="ibox-content">
	
		<form class="form-horizontal" id="dataform"
			onsubmit="javascripr:return false;">
		<input type="hidden" name="tokenUrl" value="${tokenUrl}">	 
		<input type="hidden" name="token" value="${token}">
			<input type="hidden" name="companyId" value=${user.companyId} >
			<c:if test="${obj ne null }">
				<input type="hidden" name="id" value="${obj.id }">
			</c:if>
			<div class="form-group">
				<label class="col-sm-2 control-label">规则名称：</label>
				<div class="col-sm-8">
					<input type="form-control" dataType="*1-50" class="form-control"
						value="${obj.name }" name="name" datatype="*4-16"
						nullmsg="规则名称不能为空">
					<div class="Validform_checktip"></div>
				</div>
			</div>
			<div class="form-group ">
				<label class="col-sm-2 control-label">类型：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control"  name="topType" readonly="readonly"
						value="${obj.topType }">
				</div>
			</div>
			<div class="form-group ">
				<label class="col-sm-2 control-label">时长：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control"  name="timeLong" datatype="price"
						value="${obj.timeLong }">
				</div>
			</div>
			<div class="form-group ">
				<label class="col-sm-2 control-label">价格：</label>
				<div class="col-sm-8">
					<input type="text" class="form-control"  name="price" datatype="price"
						value="${obj.price }">
				</div>
			</div>
		<div class="form-group ">
				<label class="col-sm-2 control-label">发布状态：</label>
				<div class="col-sm-8">
					<select  class="form-control" name="publishStatus" >
						<option <c:if test="${obj.publishStatus eq '上架'}">selected="selected" </c:if> value="上架">上架</option>
						<option <c:if test="${obj.publishStatus eq '下架'}">selected="selected" </c:if> value="下架">下架</option>
					</select>
				</div>
			</div>
		

			<div class="form-group ">
				<div class="col-sm-12 text-center">
					<a href="javascript:;" onclick="myForm.submit()"
						class="btn btn-success radius">保存</a>&nbsp;&nbsp;&nbsp;&nbsp; <button onclick="MTools.closeForm()" class="btn btn-danger radius"
					type="button">取消</button>
				</div>
			</div>
			<div class="form-group ">
				<div class="col-sm-12 text-center text-info">
					注：立即置顶改变时间立即生效，计划置顶改变时间没有意义。置顶规则能修改的是名称和价格，其他不建议修改
				</div>
				</div>
		</form>
	</div>
	<script type="text/javascript">
		$(function() {
			myForm = MForm.initForm({
				invokeUrl : "${path}/admin/topRule/addOrModify",
				afterSubmit : function() {
					parent.myGrid.serchData();
				},
			});
		});
	</script>
</body>
</html>